<link href="../Public/css/skin.css" rel="stylesheet" type="text/css" />
<link href="../Public/css/Dialogbox.css" rel="stylesheet"	type="text/css" />
<script language="javascript" src="../Public/js/jquery-1.4.3.min.js"></script>
<script language="javascript" src="../Public/js/core.js"></script>
<script language="javascript" src="../Public/WdatePicker/WdatePicker.js"></script>
<script language="javascript" src="../Public/js/Dialogbox.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>添加商品竞拍</title>

<style type="text/css">
	body {
		margin-left: 0px;
		margin-top: 0px;
		margin-right: 0px;
		margin-bottom: 0px;
		background-color: #EEF2FB;
	}
	
	textarea {
		display: block;
	}
</style>

<script type="text/javascript">
	var IMGPATH="../Public/images/";

	//...选择商品
	//TODO:后序优化调整
	function selectGoods() {
		/*
		addDialogbox("#viewgoods", "商品选择", 10001, 860);
		  
		$.ajax({
			url : "__APP__/Auction/viewGoods",
			cache : false,
			type : "POST",
			success : function(msg) {
				$("#viewgoods .dialogboxContent").html(msg);
			}
		});
		
		 */
		 
		 var url="__APP__/Auction/viewGoods" ;
		 openwindow(url,"选择商品",700,500);
		 
	}
	
	
	//商品ID和商品名称
	function saveGoods(gid,gname){
		$("#gid").attr("value",gid);
		$("#goodsname").attr("value",gname);
	}
	
	
	/*  
	function saveGoods() {
		//var string = $('#goods').formSerialize();
		//alert(string);   //格式gid=xx   
	
	}
	 */

	 
	 var newWindow; 
	 function openwindow(url,name,iWidth,iHeight){
	 	var url;                            //转向网页的地址;
	   	var name;                           //网页名称，可为空;
	   	var iWidth;                         //弹出窗口的宽度;
	   	var iHeight;                        //弹出窗口的高度;
	   	var iTop = (window.screen.availHeight-30-iHeight)/2;       //获得窗口的垂直位置;
	   	var iLeft = (window.screen.availWidth-10-iWidth)/2;        //获得窗口的水平位置;
	   	window.open(url,name,'height='+iHeight+',,innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
	 }
	 
	 
	 function submitFunc(){
		if(confirm("确认要将该商品添加竞拍吗")){
			$("#list").submit() ; 
		}
	 }
	 
</script>


<body>

	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="17" valign="top"
				background="../Public/images/mail_leftbg.gif"><img
				src="../Public/images/left-top-right.gif" width="17" height="29" />
			</td>
			<td valign="top" background="../Public/images/content-bg.gif">
				<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" 
					class="left_topbg" id="table2">
					<tr>
						<td height="31"><div class="titlebt">添加竞拍</div>
						</td>
					</tr>
				</table>
			</td>
			<td width="16" valign="top"
				background="../Public/images/mail_rightbg.gif"><img
				src="../Public/images/nav-right-bg.gif" width="16" height="29" />
			</td>
		</tr>
		<tr>
			<td valign="middle" background="../Public/images/mail_leftbg.gif">&nbsp;</td>
			<td valign="top" bgcolor="#F7F8F9">
				<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
					<tr>
						<td valign="top" class="td_top"></td>
					</tr>
					<tr>
						<td>
							<form method="post" id="list" action="__URL__/insert" enctype="multipart/form-data">
								<table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#CCCCCC" class="content">
								
								   	<!-- 竞拍类型默认 -->
								    <input type="hidden" name="type" id="type" value="0" />
								
									
									 <tr>
										<td class="edit_left">商品名称：</td>
										<td class="edit_right">
											<input type="hidden" name="gid" id="gid" value="" />   <!-- 商品ID -->
											<input type="text" name="goodsname" id="goodsname" value="" readonly="readonly"  class="edit_input">
											
											<input type="button" name="selGoods" id="selGoods" value="选择" onclick="selectGoods()"/>
										</td>
									</tr>
								   
									<tr>
										<td class="edit_left">竞拍编号：</td>
										<td class="edit_right">
											<input type="text" name="sn" id="sn" value="" class="edit_input">
										</td>
									</tr>
									
									
									<tr>
										<td class="edit_left">成本价：</td>
										<td class="edit_right">
											<input type="text" name="stockprice" id="stockprice" value="" class="edit_input">
										</td>
									</tr>
									
									<tr>
										<td class="edit_left">零售价：</td>
										<td class="edit_right">
											<input type="text" name="costprice" id="costprice" value="" class="edit_input">
										</td>
									</tr>
									<tr>
										<td class="edit_left">保价：</td>
										<td class="edit_right">
											<input type="text" name="goodsprice" id="goodsprice" value="" class="edit_input">
										</td>
									</tr>
									<tr>
										<td class="edit_left">开始时间：</td>
										<td class="edit_right">
											<input type="text" name="starttime" id="starttime" value="{:date('Y-m-d H:i:s',time())}" class="edit_input"
													onfocus="WdatePicker({el:$dp.$('starttime')})" 
												/>
											<img src="../Public/images/date.gif" onclick="WdatePicker({el:$dp.$('starttime')})">
										</td>
									</tr>
									<tr>
										<td class="edit_left">结束时间：</td>
										<td class="edit_right">
											<input type="text" name="endtime" id="endtime" value="{:date('Y-m-d H:i:s',time() + 86400)}"	class="edit_input" 
												onfocus="WdatePicker({el:$dp.$('endtime')})" 
											/>
											<img src="../Public/images/date.gif" onclick="WdatePicker({el:$dp.$('endtime')})">
										</td>
									</tr>
									
									<tr>
										<td class="edit_left">起始价格：</td>
										<td class="edit_right">
											<input type="text" name="startprice" id="startprice" value="0" class="edit_input">
										</td>
									</tr>
									
									<tr>
										<td class="edit_left">价格浮动：</td>
										<td class="edit_right">
											<input type="text" name="addprice" id="addprice" value="0.01" class="edit_input">
										</td>
									</tr>
									
									<tr>
										<td class="edit_left">时间浮动：</td>
										<td class="edit_right">
											<input type="text" name="addsecond" id="addsecond" value="10" class="edit_input">S
										</td>
									</tr>
									
									<tr>
										<td class="edit_left">消耗竞标币数：</td>
										<td class="edit_right">
											<input type="text" name="usebeat" id="usebeat" value="100" class="edit_input">
										</td>
									</tr>
									
									<tr>
										<td class="edit_left">推荐：</td>
										<td class="edit_right">
											<input type="checkbox" name="recommend" id="recommend" value="1">
										</td>
									</tr>




									<tr>
										<td colspan="2">
											<a href="javascript:submitFunc();"	 id="submit" class="operation_submit" style="margin-left: 430px; margin-top: 30px;"></a>
										</td>
									</tr>
									
								</table>
							</form>
							
						</td>
					</tr>
					<tr>
						<td height="40"></td>
					</tr>
					<tr>
						<td width="51%" class="left_txt"><img
							src="../Public/images/icon-mail2.gif" width="16" height="11">
							客户服务邮箱：{$Think.config.sysconfig.services_email}<br> <img
							src="../Public/images/icon-phone.gif" width="17" height="14">
							官方网站：{$Think.config.sysconfig.website}</td>
					</tr>
				</table>
			</td>
			<td background="../Public/images/mail_rightbg.gif">&nbsp;</td>
		</tr>
		<tr>
			<td valign="bottom" background="../Public/images/mail_leftbg.gif"><img
				src="../Public/images/buttom_left2.gif" width="17" height="17" />
			</td>
			<td background="../Public/images/buttom_bgs.gif"><img
				src="../Public/images/buttom_bgs.gif" width="17" height="17">
			</td>
			<td valign="bottom" background="../Public/images/mail_rightbg.gif"><img
				src="../Public/images/buttom_right2.gif" width="16" height="17" />
			</td>
		</tr>
	</table>

</body>
